package com.titaniume.rabbitmq.springbootrabbitmq.consumer;

import com.titaniume.rabbitmq.springbootrabbitmq.config.ConfirmConfig;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * @ProjectName: rabbitmq
 * @Package: com.titaniume.rabbitmq.springbootrabbitmq.consumer
 * @ClassName: WarningConsupmer
 * @Author: titan
 * @Description: 警告消费者
 * @Date: 2022/1/3 22:07
 * @Version: 1.0
 */
@Slf4j
@Component
public class WarningConsupmer {

    //接受警告消息
    @RabbitListener(queues = ConfirmConfig.WARNING_QUEUE_NAME)
    public void receiveWarningMsg(Message message){
        String msg = new String(message.getBody());
        log.info("报警发现不可路由消息：{}" ,msg);
    }
}
